import Cookies from 'js-cookie'

const TokenKey = 'vue_admin_template_token'
// cookie存储token
export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

// cookie存储用户数据
export function getUserInfo() {
  return Cookies.get('userInfo')
}

export function setUserInfo(userInfo) {
  return Cookies.set('userInfo', userInfo)
}

export function removeUserInfo() {
  return Cookies.remove('userInfo')
}

// cookie存储权限
export function getUserRoles() {
  return Cookies.get('UserRoles')
}

export function setUserRoles(UserRoles) {
  return Cookies.set('UserRoles', UserRoles)
}

export function removeUserRoles() {
  return Cookies.remove('UserRoles')
}
